package com.jiyun.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jiyun.model.xitong.Biaoqian;
import com.jiyun.service.IBiaoqianService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author author
 * @since 2024-09-21
 */
@RestController
@CrossOrigin
@RequestMapping("/biaoqian")
@Api("标签管理")
public class BiaoqianController {
    @Autowired
    IBiaoqianService  biaoqianService;



    /**
     * 查询所有标签
     */
    @ApiOperation("分页查询所有标签")
    @RequestMapping("findAll")
    public Page<Biaoqian> findAll(Integer pageNum, Integer pageSize, @RequestBody  Biaoqian biaoqian){

        return biaoqianService.findAll(pageNum,pageSize,biaoqian);

    }

    /**
     * 标签添加
     */
    @RequestMapping("add")
    @ApiOperation("标签添加")
    public Integer add( @RequestBody  Biaoqian biaoqian){

        return biaoqianService.add(biaoqian);

    }


    /**
     * 标签删除
     */
    @RequestMapping("del")
    @ApiOperation("标签删除")
    public Integer del(Integer id){
        return biaoqianService.del(id);
    }
    /**
     * 查询全部
     */
    @RequestMapping("findBiaoQian")
    @ApiOperation("查询全部标签")
    public List<Biaoqian> findBiaoQian(){
       return biaoqianService.findBiaoQian();
    }



}
